package com.qing.design.patterns.composite.example.shapes;

import java.awt.*;

/**
 * 圆形
 */
public class Circle extends BaseShape {

	public int radius;



	public Circle(int x, int y, Color color, int radius) {
		super(x, y, color);
		this.radius = radius;
	}

	@Override
	public int getWidth() {
		return radius*2;
	}

	@Override
	public int getHeight() {
		return radius*2;
	}

	public void paint(Graphics graphics){
		super.paint(graphics);
		graphics.drawOval(x,y,getWidth()-1,getHeight()-1);
	}
}
